package org.mtmi.ui.layouts;

/**
 * Data used to change GridLayout.
 */
public class GridData
{
	public boolean grab_horizontal;
	public boolean grab_vertical;
	public int align_horizontal;
	public int align_vertical;
	
	public int colspan; 
	
	/**
	 * Data used to change GridLayout for control this data is applied on (setData(M.D_LAYOUT_DATA)) 
	 * @param h_aln  horizontal alignment of control in layout cell: LEFT, RIGHT, CENTER, FILL or FILL_HORIZONTAL
	 * @param h_grab true to grab horizontal space if any
	 * @param v_aln  vertical alignment of control in layout cell: TOP, BOTTOM, CENTER, FILL or FILL_VERTICAL
	 * @param v_grab true to grab vertical space if any
	 */
	public GridData( int h_aln, boolean h_grab, int v_aln, boolean v_grab ) 
	{
		grab_horizontal  = h_grab;
		grab_vertical    = v_grab;
		align_horizontal = h_aln;
		align_vertical   = v_aln;
		colspan=1;
	}
	/**
	 * Data used to change GridLayout for control this data is applied on (setData(M.D_LAYOUT_DATA)) 
	 * @param h_aln  horizontal alignment of control in layout cell: LEFT, RIGHT, CENTER, FILL or FILL_HORIZONTAL
	 * @param h_grab true to grab horizontal space if any
	 * @param v_aln  vertical alignment of control in layout cell: TOP, BOTTOM, CENTER, FILL or FILL_VERTICAL
	 * @param v_grab true to grab vertical space if any
	 * @param _colspan columns count on which the control is span, (must be>=1)
	 */
	public GridData( int h_aln, boolean h_grab, int v_aln, boolean v_grab, int _colspan ) 
	{
		grab_horizontal  = h_grab;
		grab_vertical    = v_grab;
		align_horizontal = h_aln;
		align_vertical   = v_aln;
		assert( colspan > 0 );
		colspan=_colspan;
	}
}
